/* 文字溢出处理 */
@mixin line {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

@for $i from 2 through 5 {
  .line-#{$i} {
    @include line;
    -webkit-line-clamp: $i;
  }
}

.line-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 字体对其 */
.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* 边距 5 - 70 步伐为5 */
@for $i from 1 through 14 {
  $val: $i * 5;
  .m-#{$val} {
    margin: #{$val}px;
  }
  .mt-#{$val} {
    margin-top: #{$val}px;
  }
  .ml-#{$val} {
    margin-left: #{$val}px;
  }
  .mr-#{$val} {
    margin-right: #{$val}px;
  }
  .mb-#{$val} {
    margin-bottom: #{$val}px;
  }
  .p-#{$val} {
    padding: #{$val}px;
  }
  .pt-#{$val} {
    padding-top: #{$val}px;
  }
  .pl-#{$val} {
    padding-left: #{$val}px;
  }
  .pr-#{$val} {
    padding-right: #{$val}px;
  }
  .pb-#{$val} {
    padding-bottom: #{$val}px;
  }
}

.mt-auto {
  margin-top: auto;
}

.ml-auto {
  margin-left: auto;
}

.mr-auto {
  margin-right: auto;
}

.mb-auto {
  margin-bottom: auto;
}

/* flex */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.inline-row {
  display: inline-flex;
}

.row {
  display: flex;
}

.row,
.inline-row {
  &-column {
    flex-direction: column;
  }

  &-wrap {
    flex-wrap: wrap;
  }

  &.align-start {
    align-items: flex-start;
  }

  &.align-center {
    align-items: center;
  }

  &.align-end {
    align-items: flex-end;
  }

  &.justify-start {
    justify-content: flex-start;
  }

  &.justify-center {
    justify-content: center;
  }

  &.justify-end {
    justify-content: flex-end;
  }

  &.justify-between {
    justify-content: space-between;
  }

  &.justify-around {
    justify-content: space-around;
  }
}

.col {
  flex: 1;
}

/* 浮动 */
.clear {
  &::after {
    content: '';
    display: block;
    clear: both;
    height: 0;
  }
}

.lf {
  float: left;
}

.rf {
  float: right;
}
